package com.mobile.check.net;


import java.util.ArrayList;

import io.reactivex.Observable;
import com.mobile.check.beans.TaskInfo;
import com.mobile.check.beans.TokenInfo;
import com.mobile.check.beans.UploadFileResponse;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;


public interface ApiService {

    @FormUrlEncoded
    @POST("/api/user/login")
    Observable<BaseObjBean<TokenInfo>> login(@Field("username") String id_number, @Field("password") String password);

    @GET("/api/task/list")
    Observable<BaseObjBean<ArrayList<TaskInfo>>> taskList(@Header("token") String token);

    @GET("/api/task/recheck_list")
    Observable<BaseObjBean<ArrayList<TaskInfo>>> recheck_list(@Header("token") String token);

    @FormUrlEncoded
    @POST("/api/task/passback")
    Observable<BaseObjBean> passback(@Header("token") String token, @Field("task_id") int task_id, @Field("passback_excel") String passback_excel);

    @FormUrlEncoded
    @POST("/api/task/re_passback")
    Observable<BaseObjBean> re_passback(@Header("token") String token, @Field("task_id") int task_id, @Field("recheck_app_excel") String passback_excel);

    @POST("/api/upload")
    Observable<BaseObjBean<UploadFileResponse>> uploadFileWithRequestBody(@Body MultipartBody multipartBody);

}



